how to find character at a specific index of string in java